/**
 * Copyright(c) 2015 Jade Techonologies Co., Ltd.
 *
 * History:
 *   14-8-1 上午10:32 Created by Daisy
 */
package com.jade.framework.mom;

import com.jade.framework.base.util.SimpleParameters;

/**
 * 消息对象定义。用户自定义属性名称必须以USER_开头。
 *
 * @author Daisy
 * @version 1.0 14-8-1 上午10:32
 */
public class MomMessage
        extends SimpleParameters
{
    //消息在队列中的标识
    private String id;
    //消息主题
    private String topic;
    //消息key
    private String key;
    //消息标签
    private String tag;
    //消息延时级别
    private int delayLevel;
    //消息体
    private Object msg;

    public String getId()
    {
        return id;
    }

    public void setId(String id)
    {
        this.id = id;
    }

    public String getTopic()
    {
        return topic;
    }

    public void setTopic(String topic)
    {
        this.topic = topic;
    }

    public String getKey()
    {
        return key;
    }

    public void setKey(String key)
    {
        this.key = key;
    }

    public String getTag()
    {
        return tag;
    }

    public void setTag(String tag)
    {
        this.tag = tag;
    }

    public int getDelayLevel()
    {
        return delayLevel;
    }

    public void setDelayLevel(int delayLevel)
    {
        this.delayLevel = delayLevel;
    }

    public <T> T getMsg()
    {
        return (T) msg;
    }

    public void setMsg(Object msg)
    {
        this.msg = msg;
    }

    public enum DelayLevel
    {
        ONE_SECOND, FIVE_SENCOND,
    }
}
